module.exports = (sequelize, Sequelize) => {
	const medicine = sequelize.define(
		'med_info',
		{
			medInfoId: { type: Sequelize.STRING(10), primaryKey: true },
			YPID: {
				type: Sequelize.STRING(14),
				allowNull: false,
				field: 'YPID',
			},
			medName: { type: Sequelize.STRING(30), allowNull: false },
			medManufacture: { type: Sequelize.STRING(20), allowNull: false },
			medPrice: { type: Sequelize.STRING(255), allowNull: false },
			medRealon: { type: Sequelize.TINYINT(1), allowNull: false },
			medWebon: { type: Sequelize.TINYINT(1), allowNull: false },
			medRx: { type: Sequelize.TINYINT(1), allowNull: false },
			medMain: { type: Sequelize.STRING(255), allowNull: false },
			medContain: { type: Sequelize.CHAR(1), allowNull: false },
			medSuitable: { type: Sequelize.STRING(30) },
			medWarning: { type: Sequelize.STRING(100) },
			medUsage: { type: Sequelize.STRING(100), allowNull: false },
			medAdr: { type: Sequelize.STRING(100) },
			medCategory: {
				type: Sequelize.TINYINT(1),
				allowNull: false,
				defaultValue: 0,
			},
		},
		{
			// 禁止 updatedAt, createdAt 自增
			timestamps: false,
			// 自定义表名
			freezeTableName: true,
		}
	)

	return medicine
}
